package cn.walls1717.ggkt.user.service.impl;

import cn.walls1717.ggkt.model.user.UserInfo;
import cn.walls1717.ggkt.user.mapper.UserInfoMapper;
import cn.walls1717.ggkt.user.service.UserInfoService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * 用户表服务实现类
 *
 * @author walls1717
 * @since 2022/07/18
 */
@Service
public class UserInfoServiceImpl extends ServiceImpl<UserInfoMapper, UserInfo> implements UserInfoService {

    /**
     * 根据openId查找用户新消息
     */
    @Override
    public UserInfo getByOpenid(String openId) {
        LambdaQueryWrapper<UserInfo> lqw = new LambdaQueryWrapper<>();
        lqw.eq(UserInfo::getOpenId, openId);
        return this.getOne(lqw);
    }
}
